package com.woniuxy.commons.service;

import com.woniuxy.commons.entity.PageBean;
import com.woniuxy.commons.entity.Staff;
import com.woniuxy.commons.utils.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author author
 * @create 2021-11-10 10:47
 */
@FeignClient(name = "staff")
public interface StaffService {

    @PostMapping("/staff/addStaff")
    public ResponseResult<Staff> addStaff(@RequestBody Staff staff);

    @GetMapping("/staff/getallStaff")
    public ResponseResult<PageBean<Staff>> getAllStaff(@RequestParam("staff")Staff staff, @RequestParam("pageIndex") int pageIndex, @RequestParam("pageSize")int pageSize);


    @DeleteMapping("/staff/delStaff/{sid}")
    public ResponseResult<Staff> delStaff(@PathVariable("sid") int sid);


    @PutMapping("/staff/updateStaff")
    public ResponseResult<Staff> updateStaff(@RequestBody Staff staff);


    @GetMapping("/staff/getStaffByName/{username}")
    public Staff getStaffByName(@PathVariable("username") String username);

    @GetMapping("/staff/getpermissionByName/{username}")
    public List<String> getpermissionByName
            (@PathVariable("username") String username);


    @GetMapping("/staff/hasperms/{username}/{perms}")
    public ResponseResult hasPerms(
            @PathVariable("username") String username, @PathVariable("perms") String perms);





}
